mod request;
mod parser;

use word::Word;

pub async fn query_word(word: String) -> Result<Word, String> {
    let html = request::get_word(&word).await?;
    parser::parse(word, html)
}

#[tokio::test]
async fn query_word_test() {
    let word = query_word("daring".to_string()).await;
    match word {
        Ok(w) => { print!("{:?}", w); }
        Err(e) => { print!("{}", e); }
    }
}